<?php
    header('Access-Control-Allow-Origin: *');
	header("Access-Control-Allow-Method:POST,GET");
    header ( "Content-Type: text/html; charset=UTF-8" );
    require_once 'mysql.function.php';
	require_once 'response.class.php';
     
    $rawPostData = file_get_contents("php://input");
	$postData = json_decode($rawPostData,true);
	$id = $postData["id"];
	//实例化
    $sqlhelper = new sqlhelper();
	$re = new Response();

    $sql = "select nickname,treecomment,createtime from TreeComment where id = '$id' order by createtime desc";
    if ($sqlhelper->getResultNum($sql) == 0) {
		$message = array(
			'content' => "NULL",
		);
		$re->show(200,'fail',$message);
		exit();
	}

	$arr = $sqlhelper->fetchall($sql);
	$sqlhelper->close_connect();

	//返回json数据
	$message = array(
        //'success' => true,
		'message' => $arr
	);
	$re->show(200,'success',$message);
    //var_dump($message);
	exit();
?>